package collect;

import java.util.*;

public class NotCollection {
    public static void main(String[] args) {
        //不可变集合只能打印
        //创建集合
        HashMap<Integer, Integer> hm = new HashMap<>();
        //添加元素
        hm.put(1, 1);
        hm.put(2, 1);
        hm.put(3, 1);
        hm.put(4, 1);
        System.out.println(hm);
        System.out.println("===========================================");
        //创建可以添加多个元素的list的不可变集合
        List<String> list = List.of("徐瑞琪", "仝鲁豫", "王浩军", "朱鹏", "苟宇同", "刘国立", "朱思衡", "张迪", "侯龙飞");
        System.out.println(list);
        System.out.println("===========================================");
        //创建可以添加多个元素的set的不可变集合
        Set<String> set = Set.of("徐瑞琪", "仝鲁豫", "王浩军", "朱鹏", "苟宇同", "刘国立", "朱思衡", "张迪", "侯龙飞");
        //创建不可变的map集合
        Map<Integer, Integer> map = Map.copyOf(hm);
        //打印集合
        System.out.println(map);


    }
}
